<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 知识小课堂
      const arr = [
        { id: 1, name: '北京' },
        { id: 2, name: '上海' },
        { id: 3, name: '苏州' },
      ]

      const brr = [1, 2, 3, 4, 5]

      console.log(brr.indexOf('5'))

      const a = arr.findIndex((v) => v.id === { id: 2 }.id)

      console.log(a, 'a')
    </script>
  </body>
</html>
